<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
class Api_CityController extends Zend_Rest_Controller
{

	public function init()
	{
		$this->_helper->viewRenderer->setNoRender(true);
	}


	public function deleteAction() {

	}

	public function getAction() {

	}

	public function headAction() {

	}

	public function indexAction() {
		try{
			$city_mapper = new Api_Model_CityMapper();

			$city = $city_mapper->getAllCity();
			$this->getresponse()->appendBody(json_encode($city));
			$this->getResponse()->setHttpResponseCode(200);

		}catch(Exception $e){
			$this->getresponse()->appendBody($e->getMessage());
			$this->getResponse()->setHttpResponseCode($e->getCode());
		}
	}

	public function postAction() {

	}

	public function putAction() {

	}
}

